package com.uenpay.oem.ui.auth;

import android.os.Bundle;

import com.uenpay.oem.R;
import com.uenpay.oem.common.RxBusEventConstant;
import com.uenpay.oem.ui.main.my.MyFragment;
import com.uenpay.oem.ui.user.info.UserInfoActivity;
import com.uenpay.util.app.base.BaseFragment;
import com.uenpay.util.rx.CommonEvent;
import com.uenpay.util.rx.RxBus;

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Author: liulou
 * Date: 2017/6/18.
 * desc:
 */

public class AuthSuccessFragment extends BaseFragment {

    private static AuthFragmentChangeCallback mCallBack;
    private Unbinder mUnbinder;

    @Override
    protected void onCreateView(Bundle savedInstanceState) {
        super.onCreateView(savedInstanceState);
        setContentView(R.layout.fragment_auth_success);
        mUnbinder = ButterKnife.bind(this, getContentView());
    }

    public static AuthSuccessFragment newInstance(AuthFragmentChangeCallback callback) {
        mCallBack = callback;
        return new AuthSuccessFragment();
    }

    @OnClick(R.id.btn_complete)
    public void btnComplete() {
        RxBus.$().post(UserInfoActivity.TAG, new CommonEvent(RxBusEventConstant.EVENT_UPDATE_USER_AUTH_INFO));
        RxBus.$().post(MyFragment.TAG, new CommonEvent(RxBusEventConstant.EVENT_UPDATE_USER_AUTH_INFO));
        getActivity().finish();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }
}
